﻿@model IEnumerable<BugTracker.Models.Issue>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


   @{WebGrid webGrid = new WebGrid(canSort: false, canPage: true, rowsPerPage: 2, ajaxUpdateContainerId: "grid", defaultSort: "issue_idPK", pageFieldName: "Page");
    webGrid.Bind(Model, autoSortAndPage: true, rowCount: Model.Count());    
    }                 

<center>        
<div id="grid">
@webGrid.GetHtml(htmlAttributes: new { id = "grid" },
        alternatingRowStyle: "altrow",
        mode: WebGridPagerModes.All,
               firstText: "<<first",
               previousText: "<previous",
               nextText: "next >",
               lastText: "last >>",

         columns: webGrid.Columns(
                  webGrid.Column(columnName: "Issue ID", format: (item) => item.issue_idPK),
                  webGrid.Column(columnName: "Issue Name", format: (item) => item.issue_name),
                  webGrid.Column(columnName: "Project ID", format: (item) => item.project_idFK),
                  webGrid.Column(columnName: "Date Identified", format: (item) => item.date_identified),
                  webGrid.Column(columnName: "Status", format: (item) => item.status),
                  webGrid.Column(columnName: "Priority", format: (item) => item.priority),
                  webGrid.Column(header: "Action",
                                         style: "action",
                                         format: (item) => Html.ActionLink("Details", "DetailsIssue", new { id = item.issue_idPK }))
                                                    ))
  </div> 
  </center>
<br />
<h4>
        Page Count:
        @Html.Encode(webGrid.PageCount)
        <br />
        Total Record:
        @Html.Encode(webGrid.TotalRowCount)
</h4>
